﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace IceDog.SSO.Client3.Controllers
{
    public class AccountController : Controller
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public ActionResult Login()
        {
            FormsAuthentication.SetAuthCookie("hank", false);
            return RedirectToAction("Index", "Home");
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="returnUrl"></param>
        /// <returns></returns>
        public ActionResult Logout(string returnUrl)
        {
            FormsAuthentication.SignOut();
            HttpContext.Request.Cookies.Clear();
            return Redirect($"/Account/Login?ReturnUrl={ returnUrl}");
        }
    }
}